import { EmitterEventTypes } from '@/types/emitter'
import { Emitter } from 'mitt'
import { inject } from 'vue'

type EmitterType = Emitter<EmitterEventTypes>

export default function () {
    const emitter = inject<EmitterType>('emitter')
    return emitter
}

// demo

// import { useEventBus } from './hooks'

// const emitter = useEventBus()

// emitter?.on('abc', (e) => {})

// emitter?.on('a', (params) => {})
